package util;

import java.util.Arrays;

public class MathUtil {
	
	public static void bubbleSort(double[] numbers) {   
	    double temp; // 记录临时中间值   
	    int size = numbers.length; // 数组大小   
	    for (int i = 0; i < size - 1; i++) {   
	        for (int j = i + 1; j < size; j++) {   
	            if (numbers[i] < numbers[j]) { // 交换两数的位置   
	                temp = numbers[i];   
	                numbers[i] = numbers[j];   
	                numbers[j] = temp;   
	            }   
	        }   
	    }   
	}  
	public static void main(String[] args) {
		
		double[] numbers = new double[]{1,2,3};
		MathUtil.bubbleSort(numbers);
		System.out.print(Arrays.toString(numbers));
	}
}
